<?php
$this->adgeek_view->backyard_header();
?>
<div id="tablesorter_container">
	<?php if(!isset($adunits['items']) || empty($adunits['items'])){ ?>
		<br /><div><b>尚未建立任何廣告單元</b></div><br />
	<?php }else{ ?>
<table class="tablesorter">
	<thead>
		<tr>
			<?php foreach($table_header as $key=>$val){ 
					echo '<th>'.$table_header[$key].'</th>';
			} ?>
		</tr>
	</thead>
	<tbody>
		<?php foreach($adunits['items'] as $child_key=>$child){
				echo '<tr>';
				echo '<td>'.$child['name'].'</td>';
				echo '<td>'.$child['status'].'</td>';
				echo '<td><span id="loading" style="display:none;"><img src="/images/ajax-loader-circle.gif" /></span>';
				echo '<span>Host Channel：</span><select id=\'hostCustomChannelId_'.$child_key.'\'>';
				foreach($hostCustomChannels as $key=>$val){ 
					echo '<option value=\''.$val['id'].'\'>';
					echo $val['name']; 
					echo '</option>';
				} 
				echo '</select>&nbsp;';

				echo '<a onclick="getAdCode_show(\''.$accountID.'\',\''.$child['id'].'\',\''.$child_key.'\')" href="javascript:;">Get Code</a></td>';
				echo '</tr>';
		} ?>
	</tbody>
</table>
<?php } ?>
</div>
<?php
$this->adgeek_view->footer();
?>
